
CFLAGS = -Wall -Wextra -g -Og
FILES = -o $@_test $(filter %.c, $^)

TESTS = arith stack atom except assert mem memchk arena \
        list table set array seq ring bit \
        fmt str text \
        xp ap \
        thread sem chan \
        exam_ids exam_wf exam_xref exam_calc \
        exam_sort exam_spin exam_sieve

all: $(TESTS)

$(TESTS):
	gcc $(CFLAGS) $(FILES)

arith: arith.c arith_test.c
stack: stack.c assert.c except.c mem.c stack_test.c
atom: atom.c assert.c except.c mem.c atom_test.c
except: except.c except_test.c
assert: assert.c except.c assert_test.c
mem: mem.c assert.c except.c mem_test.c
memchk: memchk.c assert.c except.c memchk_test.c
arena: arena.c assert.c except.c arena_test.c
list: list.c mem.c assert.c except.c list_test.c
table: table.c mem.c assert.c except.c table_test.c
set: set.c mem.c assert.c except.c set_test.c
array: array.c mem.c assert.c except.c array_test.c
seq: seq.c array.c mem.c assert.c except.c seq_test.c
ring: ring.c mem.c assert.c except.c ring_test.c
bit: bit.c mem.c assert.c except.c bit_test.c
fmt: fmt.c mem.c assert.c except.c fmt_test.c
str: str.c mem.c assert.c except.c fmt.c str_test.c
text: text.c mem.c assert.c except.c fmt.c text_test.c
xp: xp.c assert.c except.c xp_test.c
ap: ap.c mem.c assert.c except.c fmt.c xp.c ap_test.c
thread: thread.c mem.c assert.c except.c thread_test.c
sem: thread.c mem.c assert.c except.c sem_test.c
chan: chan.c thread.c mem.c assert.c except.c chan_test.c

exam_ids: str.c mem.c assert.c except.c fmt.c exam_ids.c
exam_wf: table.c atom.c mem.c assert.c except.c exam_wf.c getword.c
exam_xref: table.c set.c atom.c mem.c assert.c except.c exam_xref.c getword.c
exam_calc: xp.c ap.c stack.c fmt.c mem.c assert.c except.c exam_calc.c

exam_sort: thread.c mem.c assert.c except.c exam_sort.c
exam_spin: thread.c mem.c assert.c except.c exam_spin.c
exam_sieve: thread.c chan.c mem.c assert.c except.c exam_sieve.c

